GBML manual / Tile Animation

background_animation_frame

Jumps an animated background to a frame (0 is the first) and starts that frame’s hold time again.

Works differently on Game Boy - An animated background plays only as the room's own picture; any other shows its first frame. It is shown in four greys. 3 squares are redrawn a frame, so a step that changes many squares arrives some frames late.

Works differently on Game Boy Color - An animated background plays only as the room's own picture; any other shows its first frame. A changing square keeps 4 colours (more are cut; the build says how many pixels). 6 squares are redrawn a frame, so a big step arrives a few frames late.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

background_animation_frame(picture, frame)

Arguments

NameType
picturetileset
frameint

Returns

Nothing.

Description

Jumps an animated background to a frame (0 is the first) and starts that frame hold time again. A number past the last frame wraps round to the first. If the picture is playing it goes on from that frame; if it is paused it stays on it.

A picture that is not an animated background is left alone.

Example

background_animation_frame(ts_doc_dungeon, 0);

Starts the picture over from its first frame.

On the GBA

A number past the last frame wraps round. If the background is playing it goes on from that frame.

See also: background_animation_playbackground_animation_pausebackground_animation_speedTile animation